package com.dd.common.dto.system.dict;

import com.dd.common.pojo.dto.group.CreateGroup;
import com.dd.common.pojo.dto.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author cheng
 */
@Schema(description = "字典数据DTO")
@Data
public class SysDictDataDTO implements java.io.Serializable {

    @Null(message = "ID必须为空", groups = CreateGroup.class)
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    @Schema(description = "ID", example = "1")
    @Min(value = 1, message = "ID必须是正整数")
    private Long id;
    @NotBlank(message = "字典标签不能为空", groups = CreateGroup.class)
    @Schema(description = "字典标签，如：男、女、正常", example = "男")
    private String dictLabel;

    @NotBlank(message = "字典值不能为空", groups = CreateGroup.class)
    @Schema(description = "字典值，如：1、2、3", example = "1")
    private String dictValue;
    @Schema(description = "样式类名，通常是图标类", example = "iconfont icon-xxx")
    private String cssClass;

    @Schema(description = "回显样式：标签颜色或按钮类型default, primary", example = "primary")
    private String listClass;

    @Schema(description = "是否默认值：1-是，0-否", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer isDefault;

    @Schema(description = "状态：1-启用，0-禁用", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer enabled;
}
